Optimal calcium imaging with shaped excitation Understanding information flow in the brain is dependent on simultaneously recording the activity of large neuronal populations. It seems impossible to interrogate neurons serially, and still image large populations of neurons with high temporal resolution and high signal to noise. This is linked to the inverse relationship between volume scanned, and the signal collected per voxel, at fixed spatial and temporal resolution. However, this is not a hard limit. The goal of most functional imaging is to recover and assign activity signals from neurons; here we demonstrate that nearly all past approaches have dramatically oversampled spatially to create human-interpretable images. This is not necessary ? once the spatial footprints of the observed neurons are known, constrained non-negative matrix factorization methods can extract highly accurate temporal activity signals from very low spatial resolution movies. Reducing the number of samples required in imaging allows us to significantly speed up acquisition. In this proposal we introduce a new fast computational imaging method, leveraging modern computational demixing methods with simple optical hardware to increase imaging speeds by an order of magnitude. We proposed to use modern spatial light modulator systems to provide a flexible and powerful tool for optically implementing our proposed spatial downsampling approach, while taking better advantage of laser power and avoiding standard problems with diffraction- limited imaging caused by limited dwell times on the sample. The resulting combined hardware- software solution will be inexpensive, easy to implement and maintain, and widely applicable in the hundreds of labs currently using multi-photon imaging methods. Thus, the proposed approach will enable a critical leap towards achieving the goals of the BRAIN initiative.